package com.sairobo.base.common.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.Version;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.sairobo.base.modules.sys.entity.SysUserEntity;

import java.io.Serializable;

/**
 * 基础实体类
 * @author shengming
 * @version V1.0
 * @date 2017/10/26 19:27
 */

public abstract class DataEntity<T> extends BaseEntity<T> implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableField(value = "create_by", el = "createBy.userId", fill = FieldFill.INSERT)
    protected SysUserEntity createBy; // 创建者

    @TableField(value = "update_by", el = "updateBy.userId", fill = FieldFill.UPDATE)
    protected SysUserEntity updateBy; // 更新者


    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    private Integer delFlag;

    @TableField(fill = FieldFill.INSERT)
    @Version
    private Integer version;


    public SysUserEntity getCreateBy() {
        return createBy;
    }

    public void setCreateBy(SysUserEntity createBy) {
        this.createBy = createBy;
    }

    public SysUserEntity getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(SysUserEntity updateBy) {
        this.updateBy = updateBy;
    }

    public Integer getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }
}
